package org.example.String;

/**
 * @Author : zhangbo
 * @data : 2025/3/25
 * @description :字符串中占位符替换
 */
public class Test1 {
    public static void main(String[] args) {

        String message= "对话记录:{{messages}} --- 现有知识:{{knowledges}} ";

        String messages="aaa";
        String knowledges="bbb";


        // 替换占位符
        String result = message
                .replace("{{messages}}", messages)
                .replace("{{knowledges}}", knowledges);

        System.out.println(result);

    }
}
